import request from '@/utils/request'
import qs from 'qs';
let Base64 = require('js-base64').Base64;
import md5 from 'js-md5'


export function login(data) {
  let param={
    username:Base64.encode(data.username),
    password:Base64.encode( md5(data.password)),
  }
  return request({
    url: '/doLogin',
    method: 'POST',
    contentType:'application/json',
    data:qs.stringify(param)
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-element-admin/user/info',
    method: 'GET',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/logoutForFront',
    method: 'POST'
  })
}
